package com.hzvictory.hotel_system.service.Impl;

import java.util.List;
import com.hzvictory.hotel_system.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.hzvictory.hotel_system.mapper.WebsiteinfoMapper;
import com.hzvictory.hotel_system.pojo.entity.Websiteinfo;
import com.hzvictory.hotel_system.service.IWebsiteinfoService;

/**
 * 网站信息Service业务层处理
 *
 * @author hzvictory
 * @date 2025-07-25
 */
@Service
public class WebsiteinfoServiceImpl implements IWebsiteinfoService
{
    @Autowired
    private WebsiteinfoMapper websiteinfoMapper;

    /**
     * 查询网站信息
     *
     * @param id 网站信息主键
     * @return 网站信息
     */
    @Override
    public Websiteinfo selectWebsiteinfoById(Long id)
    {
        return websiteinfoMapper.selectWebsiteinfoById(id);
    }

    /**
     * 查询网站信息列表
     *
     * @param websiteinfo 网站信息
     * @return 网站信息
     */
    @Override
    public List<Websiteinfo> selectWebsiteinfoList(Websiteinfo websiteinfo)
    {
        return websiteinfoMapper.selectWebsiteinfoList(websiteinfo);
    }

    /**
     * 新增网站信息
     *
     * @param websiteinfo 网站信息
     * @return 结果
     */
    @Override
    public int insertWebsiteinfo(Websiteinfo websiteinfo)
    {
        return websiteinfoMapper.insertWebsiteinfo(websiteinfo);
    }

    /**
     * 修改网站信息
     *
     * @param websiteinfo 网站信息
     * @return 结果
     */
    @Override
    public int updateWebsiteinfo(Websiteinfo websiteinfo)
    {
        websiteinfo.setUpdateTime(DateUtils.getNowDate());
        return websiteinfoMapper.updateWebsiteinfo(websiteinfo);
    }

    /**
     * 批量删除网站信息
     *
     * @param ids 需要删除的网站信息主键
     * @return 结果
     */
    @Override
    public int deleteWebsiteinfoByIds(Long[] ids)
    {
        return websiteinfoMapper.deleteWebsiteinfoByIds(ids);
    }

    /**
     * 删除网站信息信息
     *
     * @param id 网站信息主键
     * @return 结果
     */
    @Override
    public int deleteWebsiteinfoById(Long id)
    {
        return websiteinfoMapper.deleteWebsiteinfoById(id);
    }
}
